package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.activity.result.ActivityResultLauncher;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity2 extends AppCompatActivity {
    Button button21;

    @Override
    protected void onStart() {
        super.onStart();
        Log.d("king","Activity2:onStart...");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d("king","Activity2:onRestart...");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d("king","Activity2:onStop...");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d("king","Activity2:onResume...");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d("king","Activity2:onPause...");
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        Log.d("king","Activity2:onCreate...");





        button21=findViewById(R.id.button21);
        Intent intent= new Intent(this,MainActivity21.class);

        //intent.putExtra("name","king");
        //intent.putExtra("age",88);
        Bundle bundle=new Bundle();
        bundle.putString("name","king");
        bundle.putInt("age",88);
        intent.putExtras(bundle);


        button21.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                startActivity(intent);
            }
        });

     //   ActivityResultLauncher launcher=registerForActivityResult();
    }
}